**************************************************************************************************************************************************
****************************** Wealth-Income Ratios in Free Market Capitalism: Switzerland, 1900-2020 ********************************************
**************************************************************************************************************************************************

clear all
set more off
set scheme s1color  

**Author: Enea Baselgia and Isabel Z. Martinez
**Date: January, 25 2023

*** This master file runs all the programs required to convert the raw data into the final dataset and 
*** produces all the results that appear in the publication and online appendix. For details, see the individual do-files. 

*** INSTALL ALL REQUIRED USER-WRITTEN PACKAGES 
* ssc install wid /* package to download data directly from WID (optional) */
ssc install mylabels, replace /* package to customize figure labels */
ssc install twoway_parea, replace /* package to make patterned area plots */
ssc install _gprod, replace /* provides a multiplicative function for egen (analogous to the additive sum function) */
ssc install coefplot, replace /* package to plot coefficents after estimation */


*** SET THIS PATH TO CURRENT DIRECTORY
global mypath "C:\Users\JaneDoe\replication"


*** Data preparation
cd "$mypath/"
do "1_wid_data_prep.do"		
do "2_final_data_prep.do"		


*** Analysis to generate the results in the publication and in the online appendix
**Figures Paper 
do "3_analysis_wir_main_fig.do"		


**Figures Appendix
do "4_analysis_wir_append_fig.do"	
	

**Tables Paper and Appendix
do "7_wir_tables.do"		


**The 4 Do-Files below produces all results of the Extension in Appendix C:
** Cross-Country Evidence on WIR and Housing Prices
do "EX_C_1_readData.do"		
do "EX_C_2_plots_WIR_price_indices.do"		
do "EX_C_3_country_reg.do"		
do "EX_C_4_panel_reg.do"		


clear all

di "ALL RESULTS SUCCESSFULLY REPRODUCED."

di "THANK YOU FOR YOUR INTEREST IN OUR WORK!"

